package com.hdoit.kylin.web.group.modelconfig;

import com.hdoit.kylin.web.group.providers.PersonListProvider;
import com.hdoit.kylin.web.user.provider.TeacherProvider;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

public class ProjectConfig extends ModelMetadataAttributeConfiguration{
	public ProjectConfig(){
		this.setProperty("projectName")
			.hasAttribute(new DisplayNameAttribute("项目名"))
			.hasAttribute(new RequiredAttribute("项目名为必填项"));
		this.setProperty("projectLeaderId")
			.hasAttribute(new DisplayNameAttribute("项目负责人"))
			.hasAttribute(new RequiredAttribute("项目负责人为必填项"))
			.hasAttribute(new DropDownListAttribute(new TeacherProvider("projectLeaderId")));
		this.setProperty("projectStartDate")
			.hasAttribute(new DisplayNameAttribute("项目启动时间"))
			.hasAttribute(new DateTimeAttribute());
		this.setProperty("projectFinishDate")
			.hasAttribute(new DisplayNameAttribute("项目截止时间"));
		this.setProperty("personIds")
			.hasAttribute(new DisplayNameAttribute("参与人员"))
			.hasAttribute(new DropDownListAttribute(new PersonListProvider()));
		this.setProperty("projectComment")
			.hasAttribute(new DisplayNameAttribute("项目描述"));
			
	}
}
